<?php
	
	function __autoload($class_name)
	{
		require_once $class_name.".php";
	}
	
	$user1=new User();
	$acc1=new Account();
	$acc1->setAccHolder("Marina");
	$acc1->setAccMoney(30000);
	$user1->setUser('Marina');
	$user1->setAccount($acc1, "333");
	echo $user1->getUserName()."<br>";
	
	$acc2=new Account();
	$acc2->setAccHolder("Marina");
	$acc2->setAccMoney(10000);
	$user1->setAccount($acc2, "999");
	
	echo $user1->getUserName()."<br>";
	$AccArr=$user1->getUserAccounts();
	#echo var_dump($AccArr)."<br>";
	
	$acc1->deposit(1000);
	echo $acc1->getAccMoney()."<br>";
		
	$acc1->withdraw(300);
	echo $acc1->getAccMoney()."<br>";
	
	echo var_dump($user1->getUserAccounts())."<br>";
	
	$bank1=new Bank();
	$bank1->setBankName("OBB");
	
	$bank1->addAccout($acc1, "12345");
	$acc3=$bank1->getAccount("12345");
	echo $acc3->getAccMoney()."<br>";
	echo var_dump($bank1->getAll())."<br>";
	
	#$bank1->removeAccount("fadgjiwr");
	#$bank1->removeAccount("12345");
	#echo var_dump($bank1->getAll());
	
	$bank1->addAccout($acc2, "67890");
	echo var_dump($bank1->getAll())."<br>";
	
	$shop1=new shop();
	$shop1->setShopName("Billa");
	
	$shop1->setShopBank($bank1);
	
	
	$chocolate=new Stock();
	$chocolate->setStockName("Chocolate");
	$chocolate->setStockPrice(1.30);
	$chocolate->setStockQuantity(150);
	
	$milk=new Stock();
	$milk->setStockName("Milk");
	$milk->setStockPrice(1.90);
	$milk->setStockQuantity(200);
	
	$coffee=new Stock();
	$coffee->setStockName("Coffee");
	$coffee->setStockPrice(1.50);
	$coffee->setStockQuantity(170);
	
	$shop1->addStock($chocolate);
	$shop1->addStock($milk);
	$shop1->addStock($coffee);

	echo "<br>".var_dump($shop1->getShopStock());
	
	$user1->setShop($shop1);
	echo $user1->getShop()."<br>";
	
	$shop1->sellStock("frog", "12345", 10);
	
	$shop1->sellStock("Chocolate", "12345", 10000);
	$shop1->sellStock("Chocolate", "12345", 10);
	
	echo $shop1->getShopSum()."<br>";
	echo var_dump($chocolate)."<br>";
	
	$bank1->withdraw("12345", 100);
	echo $acc1->getAccMoney()."<br>";
	
	echo $acc1->getAccMoney();
	
?>